package com.hnkywl.sts.entity.sys;

import com.hnkywl.sts.entity.BaseEntity;
import org.hibernate.annotations.Where;

import javax.persistence.*;
import java.util.List;

/**
 * 说明：
 * 包:        com.hnkywl.sts.entity.sys
 * 类描述:    品名
 * 创建人:    zcg
 * 创建时间: 13-2-18 上午10:24
 * 修改人:    zcg
 * 修改时间: 13-2-18 上午10:24
 * 修改备注: [说明本次修改内容]
 * 版本:        [v1.0]
 */
@Entity
@Table(name = "T_SYS_PM")
@Where(clause = "deleted!='1'")
public class Pm extends BaseEntity{
    @Id
    @SequenceGenerator(name = "seqPm", allocationSize = 1, sequenceName = "SEQ_SYS_PM")
    @GeneratedValue(strategy = GenerationType.SEQUENCE, generator = "seqPm")
    private Long id;
    /**
     * 品名
     */
    @Column(name = "name")
    private String name;
    /**
     * 品名编码
     */
    @Column(name = "code")
    private String code;
    /**
     * 描述
     */
    @Column(name = "remark")
    private String remark;
    /**
     * 所属二级物资编码
     */
    @ManyToOne
    @JoinColumn(name = "rjwzbm_id")
    @Where(clause = "deleted!='1'")
    private Rjwzbm rjwzbm;
    /**
     * 所包含的规格
     */
    @OneToMany(mappedBy = "pm", cascade = CascadeType.ALL,
            fetch = FetchType.LAZY, targetEntity = Gg.class)
    @Where(clause = "deleted!='1'")
    private List<Gg> ggList;

    /**
     * 简称
     */
    private String jc;

    /**
     * 供应商名称
     */
    private String gysmc;


    public Long getId() {
        return id;
    }

    public void setId(Long id) {
        this.id = id;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getCode() {
        return code;
    }

    public void setCode(String code) {
        this.code = code;
    }

    public String getRemark() {
        return remark;
    }

    public void setRemark(String remark) {
        this.remark = remark;
    }

    public Rjwzbm getRjwzbm() {
        return rjwzbm;
    }

    public void setRjwzbm(Rjwzbm rjwzbm) {
        this.rjwzbm = rjwzbm;
    }

    public List<Gg> getGgList() {
        return ggList;
    }

    public void setGgList(List<Gg> ggList) {
        this.ggList = ggList;
    }

    public String getGysmc() {
        return gysmc;
    }

    public void setGysmc(String gysmc) {
        this.gysmc = gysmc;
    }

    public String getJc() {
        return jc;
    }

    public void setJc(String jc) {
        this.jc = jc;
    }

}
